package cn.net.wanji.entity.deviceStatus;

import cn.net.wanji.entity.AntennaInfo;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author guodejun
 * @createTime 2022/11/18 16:39
 * @description
 */
@Data
public class DeviceStatus {

    String gantryId;
    String createTime;

    List<ControllerHeartbeat> controllerHeartbeatList;
    List<CameraHeartbeat> cameraHeartbeatList;
    List<LaserHeartbeat> laserHeartbeatList;
    List<RsuHeartbeat> rsuHeartbeatList;
    List<ReAntennaInfo> antennaInfoList;


    public List<AntennaInfo> getAntennaInfoList() {
        ArrayList<AntennaInfo> antennaInfoArrayList = new ArrayList<>();
        // 天线信息状态单元状态
        if (antennaInfoList != null) {
            System.out.println(antennaInfoList);
            for (ReAntennaInfo reAntennaInfo : antennaInfoList) {
                AntennaInfo antennaInfo = new AntennaInfo();
                antennaInfo.setDeviceId(reAntennaInfo.getDeviceId());
                antennaInfo.setStatus(reAntennaInfo.getStatus());
                antennaInfo.setGantryId(gantryId);
                antennaInfo.setAId(gantryId + "+" + reAntennaInfo.getDeviceId());
                antennaInfo.setUpdateTime(createTime);
                antennaInfoArrayList.add(antennaInfo);
            }
        }
        return antennaInfoArrayList;
    }
}
